package com.ayu.shortlink.table;

import org.junit.Test;

public class generateTable {
    private final String VipUserSQL = "CREATE TABLE `t_vip_user_%s` (\n" +
            "  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',\n" +
            "  `shop_number` varchar(256) DEFAULT NULL COMMENT '商家ID',\n" +
            "  `user_id` varchar(256) DEFAULT NULL COMMENT '用户ID',\n" +
            "  `phone` varchar(128) DEFAULT NULL COMMENT '手机号',\n" +
            "  `mail` varchar(512) DEFAULT NULL COMMENT '邮箱',\n" +
            "  `create_time` datetime DEFAULT NULL COMMENT '创建时间',\n" +
            "  `update_time` datetime DEFAULT NULL COMMENT '修改时间',\n" +
            "  `del_flag` tinyint(1) DEFAULT NULL COMMENT '删除标识 0：未删除 1：已删除',\n" +
            "  PRIMARY KEY (`id`),\n" +
            "  UNIQUE KEY `idx_unique_shopNumber_userId` (`shop_number`,`user_id`) USING BTREE\n" +
            ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;";

    @Test
    public void genVipUserTale(){
        //分四张表
        for (int i = 0; i < 4; i++) {
            System.out.printf((VipUserSQL) + "%n", i);
        }
    }
}
